import { BaseWindow } from "../../../../component/window/BaseWindow";
import { ResouceConst } from "../../../../component/gconst/ResouceConst";
import { Language } from "../../../../../extend/language/Language";
import { GTextFiled } from "../../../../../com/mui/controls/GTextFiled";
import { RadioButtonGroup } from "../../../../../fl/controls/RadioButtonGroup";
import { GRadioButton } from "../../../../../com/mui/controls/GRadioButton";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { GButton } from "../../../../../com/mui/controls/GButton";
import { Dispatcher } from "../../../../mvc/core/Dispatcher";
import { DataEvent } from "../../../events/DataEvent";
import { EventName } from "../../../mvc/EventName";
import { GLabel } from "../../../../../com/mui/controls/GLabel";
import { ScaleBitmap } from "../../../../../com/mui/display/ScaleBitmap";
//class GuildBuyManorWindow
    
    export  class GuildBuyManorWindow extends BaseWindow
    {
        constructor()
        {
            super();
            this._npcInfoArray = [];
            this.init();
            return;
        }

        public init(): void
        {
            this.setSize(300, 265);
            this.titleHeight = 28;
            var loc1=16777113;
            this._windowCenterB = ResouceConst.getScaleBitmap("WindowCenterB");
            this._windowCenterB.width = 275;
            this._windowCenterB.height = 215;
            this._windowCenterB.x = 12;
            this._windowCenterB.y = 39;
            this.addChild(this._windowCenterB);
            this.title = Language.getString(57071);
            this._tipText = new GTextFiled();
            this._tipText.textColor = 11595775;
            this._tipText.autoSize = flash.text.TextFieldAutoSize.CENTER;
            this._tipText.htmlText = Language.getString(57072);
            this._tipText.x = 15;
            this._tipText.y = 45;
            this._tipText.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this.addChild(this._tipText);
            this._typeRadioGroup = new RadioButtonGroup("type");
            this._moneyRadio = new GRadioButton();
            this._moneyRadio.group = this._typeRadioGroup;
            this._moneyRadio.selected = true;
            this._moneyRadio.value = false;
            this._moneyRadio.label = Language.getString(57073);
            this._moneyRadio.textField.autoSize = flash.text.TextFieldAutoSize.CENTER;
            this._moneyRadio.styleName = "GRadioButton";
            this._moneyRadio.move(70, 130);
            this.addChild(this._moneyRadio);
            this._moneyBitmap = GlobalClass.getBitmap(ImagesConst.Tongqian);
            this._moneyBitmap.x = this._moneyRadio.x + this._moneyRadio.width + 10;
            this._moneyBitmap.y = 132;
            this.addChild(this._moneyBitmap);
            this._propRadio = new GRadioButton();
            this._propRadio.group = this._typeRadioGroup;
            this._propRadio.value = true;
            this._propRadio.label = Language.getString(57074);
            this._propRadio.textField.autoSize = flash.text.TextFieldAutoSize.CENTER;
            this._propRadio.styleName = "GRadioButton";
            this._propRadio.move(70, 160);
            this.addChild(this._propRadio);
            this._okButton = new GButton();
            this._okButton.name = "okButton";
            this._okButton.styleName = "Button";
            this._okButton.label = Language.getString(57075);
            this._okButton.setSize(65, 27);
            this._okButton.move(85, 220);
            this._okButton.addEventListener(flash.events.MouseEvent.CLICK, this.onOkButtonClickHandler);
            this.addChild(this._okButton);
            this._cancelButton = new GButton();
            this._cancelButton.name = "cancelButton";
            this._cancelButton.styleName = "Button";
            this._cancelButton.label = Language.getString(57076);
            this._cancelButton.setSize(65, 27);
            this._cancelButton.move(155, 220);
            this._cancelButton.addEventListener(flash.events.MouseEvent.CLICK, this.onCancelButtonClickHandler);
            this.addChild(this._cancelButton);
            return;
        }

        public onOkButtonClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=this._typeRadioGroup.selection as GRadioButton;
            var loc2=loc1.value as Boolean;
            Dispatcher.dispatchEvent(new DataEvent(EventName.GuildBuyManor, loc2));
            return;
        }

        public onCancelButtonClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            this.hide();
            return;
        }

        /* internal */ /* var */_titleLabel: GLabel;

        /* internal */ /* var */_tipText: GTextFiled;

        /* internal */ /* var */_moneyRadio: GRadioButton;

        /* internal */ /* var */_moneyBitmap: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_propRadio: GRadioButton;

        /* internal */ /* var */_typeRadioGroup: RadioButtonGroup;

        /* internal */ /* var */_okButton: GButton;

        /* internal */ /* var */_cancelButton: GButton;

        /* internal */ /* var */_windowCenterB: ScaleBitmap;

        /* internal */ /* var */_npcInfoArray: Array<any>;
    }
